KERNEL_DIR=/home/guo/tools/linux_sdk/sdk/kernel
INCLUDE_DIR=$(src)/include/
COMPILER_DIR=/home/guo/tools/linux_sdk/sdk/prebuilts/gcc/linux-x86/aarch64/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/bin/
CROSS_COMPILE=aarch64-none-linux-gnu-
ARCH=arm64
MODULE=rk3588-gpio-test

obj-m += ${MODULE}.o
ccflags-y += -I${INCLUDE_DIR}
all : modules
modules :
	make -C ${KERNEL_DIR} M=$(shell pwd) ARCH=${ARCH} CROSS_COMPILE=${COMPILER_DIR}${CROSS_COMPILE} modules
clean :
	make -C ${KERNEL_DIR} M=$(shell pwd) ARCH=${ARCH} CROSS_COMPILE=${COMPILER_DIR}${CROSS_COMPILE} clean
	rm -rfv $(shell pwd)/${MODULE}_test	
test :
	${COMPILER_DIR}${CROSS_COMPILE}gcc ${MODULE}_test.c -o ${MODULE}_test -Og -g -I${INCLUDE_DIR}